
  <%
sql1 = "SELECT * FROM usuarios ORDER BY usuario"
sql2 = "SELECT * FROM categorias ORDER BY nome"
sql3 = "SELECT * FROM itens ORDER BY nome"
set usr = con.execute(sql1)
set cat = con.execute(sql2)
set url = con.execute(sql3)

select case nivel 
case "1"
dd = "Nome da Categoria"
cc = "nome"
tipo = "categorias"
case "2"
dd = "Nome do Site"
tipo = "itens"
cc = "nome"
case "3"
dd = "Usurio"
tipo = "usuarios"
cc = "usuario"
end select
%> 
  <form method="post" action="processa.asp?tipo=<%=tipo%>&nivel=<%=nivel%>&acao=edita">
<%
select case nivel
case "1"
cat.movefirst
do while not cat.eof

nome = cat("nome")
desc = cat("descricao")
%> 
    <table width="100%" border="1">
  <tr bgcolor="#009966"> 
    <td><font color="#FFFFFF" face="Courier New, Courier, mono">Nome</font></td>
    <%if nivel = "1" or nivel = "2" then%> 
    <td><font color="#FFFFFF" face="Courier New, Courier, mono">Descri&ccedil;&atilde;o</font></td>
    <%end if%> 
    <td><font color="#FFFFFF" face="Courier New, Courier, mono">Alterar</font></td>
  </tr>
<tr> 
      <td> 
        <input type="text" name="nome" value="<%=nome%>">
      </td>
      <td> 
        <input type="text" name="textfield2" value="<%=desc%>">
      </td>
      <td> 
        <input type="submit" name="altera" value="Alterar">
      </td>
    </tr></table>
    <%cat.movenext%><%loop%> 



<%case "3" 
usr.movefirst
do while not usr.eof
nome = usr("usuario")
senha = usr("senha")
%> <table width="100%" border="1">
  <tr bgcolor="#009966"> 
    <td><font color="#FFFFFF" face="Courier New, Courier, mono">Nome</font></td>
<td><font color="#FFFFFF" face="Courier New, Courier, mono">Senha</font></td>
<td><font color="#FFFFFF" face="Courier New, Courier, mono">Alterar</font></td>
  </tr>
    <tr> 
      <td> 
        <input type="text" name="nome" value="<%=nome%>">
      </td>
      <td> 
        <input type="text" name="senha" value="<%=senha%>">
      </td>
      <td> 
        <input type="submit" name="altera" value="Alterar">
      </td>
    </tr></table><%usr.movenext%><%loop%><%end select%>
  </form>
  <tr bordercolor="#FFFFFF" bgcolor="#009966"> 
    <td colspan="6">&nbsp;</td>
  </tr>
</table>